
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    url: app.globalData.imgUrl,
    localImg: app.globalData.staticimgUrl,  // 本地图片
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
  
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    if (wx.getStorageSync('orderJump') == true) {
      wx.removeStorageSync('orderJump');
      wx.navigateTo({
        url: '/pages/user-my-order-list/user-my-order-list?type=2',
      });
    }
    this.loadings();
  },
  loadings: function() {
    var that = this;
    app.request({
      url: 'doctor/member/detail',
      success: function(res) {
        that.setData({
          core: res.data[0],
          name: res.data[0].name,
          headPic: res.data[0].headPic,
          mobile: res.data[0].mobile,
        })
      }
    })
  },
  handleContact(e) {
    console.log('客服消息')
    console.log(e);
  },
  gosystem: function() {
    var mobile = this.data.mobile;
    wx.navigateTo({
      url: '../user-my-setup/user-my-setup?mobile=' + mobile,
    })
  },
  //跳转
  beautyValue: function() {
    wx.navigateTo({
      url: '../user-my-rank/user-my-rank',
    })
  },
  beautyCoin: function() {
    var userid = wx.getStorageSync('userid');
    wx.navigateTo({
      url: '../doctor-my-task/doctor-my-task?id=' + userid,
    })
  },
  onShareAppMessage: function () {
    return {
      title: '分享好友获取美丽币！',
      path: '/pages/index/index',
      // imageUrl: '/pages/images/aa.jpg',
      success: function () {
        app.request({
          url: 'doctor/memberTaskApi/addBeauty',
          data: {
            userId: wx.getStorageSync('userid'),
            type: 3
          },
          success(res) {
            console.log('分享给美丽币给美丽值', res);
          }
        })
      }
    }
  }
})